<?php
/**
 * Created by PhpStorm.
 * User: jc234839
 * Date: 20/04/14
 * Time: 11:02 AM
 */
require 'init.php';
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link href="css/main.css" rel="stylesheet" type="text/css">
    <title>Steamy Tees - Home</title>
    <meta name="description" content="Home of Steampunk clothing and merchandise">
    <meta name="keywords" content="steampunk, tshirts, shopping">
</head>
<body>
<div id="container">
    <div id="leftCogSplash"><img src="images/cogLeft.png" alt="Left Steampunk Cog"/></div>
    <div id="rightCogSplash"><img src="images/cogRight.png" alt="Right Steampunk Cog"/></div>
    <?php include "navbar.php"; ?>
    <div id="content">
        <h2>Welcome To Steamy Tees</h2>
        <p style="text-align: center">
            Buy it : Live it : Love it
        </p>

        <div class="featured">
        <?php
                $sql = "SELECT P.ProductName, P.UnitPrice, I.Path FROM Products AS P, Images AS I WHERE P.ProductID = I.ProductID AND P.IsFeatured = 1";
				$result = $db->query($sql);
				$rows = $result->fetchall(PDO::FETCH_ASSOC);
				
                foreach($rows as $row)
				{
			?>
                    <div class="featuredProducts" onclick="location.href='gallery.php'">
                        <img src="<?php echo $row['Path'] ?>" alt="<?php echo $row['ProductName'] ?>" />
                        <br/>
                        <p><?php  echo $row['ProductName'] . ' - $' . $row['UnitPrice']?></p>
                    </div>
                <?php
                }
                ?>
        </div>
        <p>
            Custom Steampunks tees designed to be worn by <b>YOU</b>!
        </p>
        <p>
            Thanks for dropping by and having a look around our site.
        </p>
        <p>
            Here at Steamy Tees we love it when people check us out, that's what we are all about,
            stepping out in your own personalised custom steampunk designed tee-shirt.
        </p>
        <p>
            Choose a design that suits your steamy personality and step out in your own style. Check out our <a
                href="gallery.php">gallery</a> page for all our designs
            or simply go through the selections we have on display here.
        </p>
        <p>
            Love to live steam punk?
        </p>
        <p>
            We would love to see you in your Steamy Tees, upload a pic on our Facebook page and let everyone know how
            punky you are!
        </p>
    </div>
    <?php require 'footer.php' ?>
</div>

</body>
</html>